import { getDictionary } from "@/api/common";
import { ref } from "vue";

export function useDictionary() {
  const getDict = (dictType: string, data: any) => {
    getDictionary({ dictType }).then((res: any) => {
      data.value = {
        label: res.dictLabel,
        value: res.dictValue,
      };
    });
  };

  return {
    getDict,
  };
}
